package nodes

import (
	"gitee.com/zfd81/dbrs/sql"
	"vitess.io/vitess/go/sqltypes"
)

// ShowEngines is a node that shows the databases.
type DescTable struct {
}

// NewShowDatabases creates a new show databases node.
func NewDescTable() *DescTable {
	return new(DescTable)
}

// Resolved implements the Resolvable interface.
func (p *DescTable) Resolved() bool {
	return true
}

// Schema implements the Node interface.
func (*DescTable) Schema() sql.Schema {
	return sql.Schema{{Name: "Field", Type: sqltypes.Text, Nullable: false},
		{Name: "Type", Type: sqltypes.Text, Nullable: false},
		{Name: "Null", Type: sqltypes.Text, Nullable: false},
		{Name: "Key", Type: sqltypes.Text, Nullable: false},
		{Name: "Default", Type: sqltypes.Text, Nullable: false},
		{Name: "Extra", Type: sqltypes.Text, Nullable: false},
		{Name: "Comment", Type: sqltypes.Text, Nullable: false},
	}
}

func (p DescTable) String() string {
	return "DescTable"
}
